package pers.qianyu.module.core.domain.system.dto;

import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author mizzle rain
 * @date 2021-04-06 13:35
 */
public class SysUserForUpdateDTO implements Serializable {
    private static final long serialVersionUID = -5678840161287697701L;
    @NotNull(message = "用户名 ID 为空")
    private Long id;
    @NotBlank(message = "用户昵称不能为空")
    private String nickname;
    private String email;
    private String phone;
    @Range(max = 2, min = 0, message = "用户性别只能是 1 或 0 或 2 ")
    private Integer gender;
    @NotBlank(message = "用户名头像链接为空")
    private String avatar;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public SysUserForUpdateDTO(@NotBlank(message = "用户名 ID 为空") Long id, @NotBlank(message = "用户昵称不能为空") String nickname, String email, String phone, @Range(max = 2, min = 0, message = "用户性别只能是 1 或 0 或 2 ") Integer gender, @NotBlank(message = "用户名头像链接为空") String avatar) {
        this.id = id;
        this.nickname = nickname;
        this.email = email;
        this.phone = phone;
        this.gender = gender;
        this.avatar = avatar;
    }

    public SysUserForUpdateDTO() {
    }

    @Override
    public String toString() {
        return "SysUserForUpdateDTO{" +
                "id=" + id +
                ", nickname='" + nickname + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", gender=" + gender +
                ", avatar='" + avatar + '\'' +
                '}';
    }
}
